﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.Execution;

namespace NUnitForVSTS.NUnitTest.UT
{
    [Serializable]
    class DummyContextAccessor: IContextAccessor
    {
        public DummyContextAccessor()
        {
            container = new Dictionary<string, object>(); 
        }

        Dictionary<string, object> container;

        #region IContextAccessor Members

        public void AddDoubleValue(string key, double value)
        {
            container.Add(key, value);
        }

        public void AddIntValue(string key, int value)
        {
            container.Add(key, value);
        }

        public void AddObject(string key, object obj)
        {
            container.Add(key, obj);
        }

        public void AddStringValue(string key, string value)
        {
            container.Add(key, value);
        }

        public int Count
        {
            get { return container.Count(); }
        }

        public double GetDoubleValue(string key)
        {
            return (double)container[key];
        }

        public System.Collections.IDictionaryEnumerator GetEnumerator()
        {
            return container.GetEnumerator();
        }

        public int GetIntValue(string key)
        {
            return (int)container[key];
        }

        public object GetObject(string key)
        {
            return container[key];
        }

        public string GetStringValue(string key)
        {
            return (string)container[key];
        }

        public void RemoveValue(string key)
        {
            container.Remove(key);
        }

        #endregion
    }
}
